<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:o="http://omnifaces.org/ui">
<f:view>
    <h:head>
        <meta http-equiv="Cache-Control" content="no-store"/>
        <meta http-equiv="Pragma" content="no-cache"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="icon" href="#{request.contextPath}/images/favicon.ico"/>
        <title><ui:insert name="title">Home</ui:insert> | #{text['webapp.name']}</title>
        <ui:include src="/common/assets.xhtml"/>
    </h:head>

    <body id="#{bodyId}">
    <c:set var="currentMenu"><ui:insert name="menu"/></c:set>

    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#{request.contextPath}">#{text['webapp.name']}</a>
        </div>

        <o:resourceInclude path="/common/menu.jsp"/>
        <c:if test="${facesContext.externalContext.requestLocale ne 'en'}">
            <div id="switchLocale"><a href="#{request.contextPath}/?locale=en">
                #{text['webapp.name']} in English</a>
            </div>
        </c:if>
    </div>

    <div class="container" id="content">
        <o:resourceInclude path="/common/messages.jsp"/>
        <div class="row">
            <ui:insert name="body"/>
            <h:panelGroup layout="block" styleClass="col-sm-2" rendered="#{menu == 'AdminMenu'}">
                <o:resourceInclude path="/common/menu-admin.jsp"/>
            </h:panelGroup>
        </div>
    </div>

    <div id="footer" class="container navbar-fixed-bottom">
        <span class="col-sm-6 text-left">#{text['webapp.version']}
            <c:if test="${pageContext.request.remoteUser != null}">
                | #{text['user.status']} ${pageContext.request.remoteUser}
            </c:if>
        </span>
        <span class="col-sm-6 text-right">
            <c:set var="companyLink">#{text['company.url']}</c:set>
            &#169; #{text['copyright.year']} <a href="${companyLink}">#{text['company.name']}</a>
        </span>
    </div>

    <ui:insert name="scripts"/>
    </body>
</f:view>
</html>
